<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">



  
  
    
      
    
    
      
    
  <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
  <link href="//cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-flash.min.css" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
    
  
  <link href="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet" type="text/css">







  

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico?v=">


  <link rel="mask-icon" href="/images/logo.svg?v=" color="#222">





  <meta name="keywords" content="linux,java,tomcat,">





  <link rel="alternate" href="/atom.xml" title="WhiteWater" type="application/atom+xml">






<meta name="description" content="linux配置tomcat一.tomcat简介​    Tomcat是Apache 软件基金会（Apache Software Foundation）的Jakarta 项目中的一个核心项目。因为Tomcat 技术先进、性能稳定，而且免费，因而深受Java爱好者的喜爱，并得到了部分软件开发商的认可，成为目前比较流行的Web 应用服务器。">
<meta name="keywords" content="linux,java,tomcat">
<meta property="og:type" content="article">
<meta property="og:title" content="linux下安装和配置tomcat">
<meta property="og:url" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/index.html">
<meta property="og:site_name" content="WhiteWater">
<meta property="og:description" content="linux配置tomcat一.tomcat简介​    Tomcat是Apache 软件基金会（Apache Software Foundation）的Jakarta 项目中的一个核心项目。因为Tomcat 技术先进、性能稳定，而且免费，因而深受Java爱好者的喜爱，并得到了部分软件开发商的认可，成为目前比较流行的Web 应用服务器。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578405162547.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578405812010.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578405860157.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578406873862.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578407111469.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578407254490.png">
<meta property="og:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578407446822.png">
<meta property="og:updated_time" content="2020-01-15T14:48:27.320Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="linux下安装和配置tomcat">
<meta name="twitter:description" content="linux配置tomcat一.tomcat简介​    Tomcat是Apache 软件基金会（Apache Software Foundation）的Jakarta 项目中的一个核心项目。因为Tomcat 技术先进、性能稳定，而且免费，因而深受Java爱好者的喜爱，并得到了部分软件开发商的认可，成为目前比较流行的Web 应用服务器。">
<meta name="twitter:image" content="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/1578405162547.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/">





  <title>linux下安装和配置tomcat | WhiteWater</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?e46442d1930481b98d53762512c55bc1";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">WhiteWater</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Thirst most</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="ctrl">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/bbb.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="WhiteWater">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">linux下安装和配置tomcat</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-01-07T21:23:50+08:00">
                2020-01-07
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux/" itemprop="url" rel="index">
                    <span itemprop="name">linux</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2020/01/07/linux下安装和配置tomcat/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/2020/01/07/linux下安装和配置tomcat/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/2020/01/07/linux下安装和配置tomcat/" class="leancloud_visitors" data-flag-title="linux下安装和配置tomcat">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  607
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  2
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="linux配置tomcat"><a href="#linux配置tomcat" class="headerlink" title="linux配置tomcat"></a><strong>linux配置tomcat</strong></h1><h2 id="一-tomcat简介"><a href="#一-tomcat简介" class="headerlink" title="一.tomcat简介"></a>一.tomcat简介</h2><p>​    <code>Tomcat</code>是<code>Apache</code> 软件基金会（<code>Apache Software Foundation</code>）的<code>Jakarta</code> 项目中的一个核心项目。因为<code>Tomcat</code> 技术先进、性能稳定，而且免费，因而深受<code>Java</code>爱好者的喜爱，并得到了部分软件开发商的认可，成为目前比较流行的<code>Web</code> 应用服务器。<br><a id="more"></a></p>
<p>​    <code>Tomcat</code>服务器是一个免费的开放源代码的<code>Web</code> 应用服务器，属于轻量级应用服务器。</p>
<p>​    当配置正确时，<code>Apache</code> 为<code>HTML</code>页面服务，而<code>Tomcat</code> 实际上运行<code>JSP</code> 页面和<code>Servlet</code>。另外，<code>Tomcat</code>还是一个<code>Servlet</code>和<code>JSP</code>容器，独立的<code>Servlet</code>容器是<code>Tomcat</code>的默认模式。不过，<code>Tomcat</code>处理静态<code>HTML</code>的能力不如<code>Apache</code>服务器。目前<code>Tomcat</code>最新版本为<strong>9.0.30</strong>。</p>
<p>官网：<a href="http://tomcat.apache.org/" target="_blank" rel="noopener">http://tomcat.apache.org/</a></p>
<h2 id="二-tomcat下载和安装"><a href="#二-tomcat下载和安装" class="headerlink" title="二.tomcat下载和安装"></a>二.tomcat下载和安装</h2><h3 id="前置条件"><a href="#前置条件" class="headerlink" title="前置条件"></a>前置条件</h3><p>​    安装tomcat之前要先安装jdk，见<a href="https://blog.yuanww.cn/2019/12/27/linux%E4%B8%8B%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEjdk/" target="_blank" rel="noopener">linux下安装和配置jdk</a>。</p>
<h3 id="下载"><a href="#下载" class="headerlink" title="下载"></a>下载</h3><p>​    先从tomcat网站上下载最新的gz安装包</p>
<p><a href="https://tomcat.apache.org/download-90.cgi" target="_blank" rel="noopener">tomcat官网下载页面</a></p>
<p>​    找到linux对应的tomcat安装包</p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578405162547.png" alt="1578405162547"></p>
<h3 id="上传"><a href="#上传" class="headerlink" title="上传"></a>上传</h3><p>​    使用<code>ftp</code>工具（我这里使用的是<code>FileZilla</code>）将下载好的文件上传到服务器 <code>/opt</code> 目录下</p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578405812010.png" alt="1578405812010"></p>
<h3 id="解压"><a href="#解压" class="headerlink" title="解压"></a>解压</h3><p>​    进入opt目录，解压文件 </p>
<p>​    解压命令 <code>tar -xzvf  apache-tomcat-9.0.30.tar.gz</code> </p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578405860157.png" alt="1578405860157"></p>
<h2 id="三-tomcat配置"><a href="#三-tomcat配置" class="headerlink" title="三.tomcat配置"></a>三.tomcat配置</h2><h3 id="环境变量配置"><a href="#环境变量配置" class="headerlink" title="环境变量配置"></a>环境变量配置</h3><p>编辑环境变量配置文件：<code>vim /etc/profile</code><br> 在文件末尾位置添加如下内容(<code>CATALINA_HOME</code>为安装tomcat的路径)<br> <code>export CATALINA_HOME=/opt/apache-tomcat-9.0.30</code><br> 通过vim的 <code>&quot;:wq&quot;</code> 命令进行保存退出<br> 使配置生效：<code>source /etc/profile</code></p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578406873862.png" alt="1578406873862"></p>
<h3 id="字符集配置"><a href="#字符集配置" class="headerlink" title="字符集配置"></a>字符集配置</h3><p>进入tomcat安装目录的conf目录，编辑<code>server.xml</code>文件<br> <code>cd /opt/apache-tomcat-9.0.30/conf</code><br> <code>vim server.xml</code><br> 找到配置8080端口的位置，在节点末尾添加<code>URIEncoding=&quot;UTF-8&quot;</code><br><code>&quot;:wq&quot;</code> 命令进行保存退出</p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578407111469.png" alt="1578407111469"></p>
<h3 id="tomcat验证"><a href="#tomcat验证" class="headerlink" title="tomcat验证"></a>tomcat验证</h3><p>进入tomcat安装目录的bin目录，执行<code>./startup.sh</code>，看到如图提示代表启动成功。</p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578407254490.png" alt="1578407254490"></p>
<p>可以通过主机的ip地址+8080端口访问tomcat主页，比如：<a href="http://192.168.130.128:8080/" target="_blank" rel="noopener">http://192.168.130.128:8080/</a><br>需要注意检查防火墙是否关闭，如果未关闭需要配置iptables规则开放8080端口。<br>关闭iptables防火墙：<code>chkconfig iptables off</code><br>关闭firewall防火墙 ：<code>service firewalld stop</code></p>
<h3 id="本地验证"><a href="#本地验证" class="headerlink" title="本地验证"></a>本地验证</h3><p>成功启动后浏览器输入<a href="http://192.168.130.128:8080/查看信息（ip为服务器ip）" target="_blank" rel="noopener">http://192.168.130.128:8080/查看信息（ip为服务器ip）</a></p>
<p><img src="/2020/01/07/linux下安装和配置tomcat/1578407446822.png" alt="1578407446822"></p>
<p>出现上图所示，说明大功告成！</p>
<p>至此，tomcat安装完成，后续可添加项目重启tomcat服务。</p>

      
    </div>
    
    
    
    <div>
      
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/2020/01/07/linux下安装和配置tomcat/">linux下安装和配置tomcat</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 ctrl 的个人博客">ctrl</a></p>
  <p><span>发布时间:</span>2020年01月07日 - 21:01</p>
  <p><span>最后更新:</span>2020年01月15日 - 22:01</p>
  <p><span>原始链接:</span><a href="/2020/01/07/linux下安装和配置tomcat/" title="linux下安装和配置tomcat">http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/</a>
    <span class="copy-path" title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="http://yuanww.cn/2020/01/07/linux下安装和配置tomcat/" aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>
</div>
<script>
    var clipboard = new Clipboard('.fa-clipboard');
    $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({
          title: "",
          text: '复制成功',
          icon: "success",
          showConfirmButton: true
          });
    });
    });
</script>


      
    </div>

    

    <div>
      
        <div>
    
        <br>
        <div style="text-align:center;color: #ccc;font-size:30px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      
    </div>

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/linux/" rel="tag"><i class="fa fa-tag"></i> linux</a>
          
            <a href="/tags/java/" rel="tag"><i class="fa fa-tag"></i> java</a>
          
            <a href="/tags/tomcat/" rel="tag"><i class="fa fa-tag"></i> tomcat</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/01/07/dubbo系列-一/" rel="next" title="dubbo系列(一 dubbo简介)">
                <i class="fa fa-chevron-left"></i> dubbo系列(一 dubbo简介)
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/01/09/linux下安装和配置maven/" rel="prev" title="linux下安装和配置maven">
                linux下安装和配置maven <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        
  <div class="bdsharebuttonbox">
    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
    <a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a>
    <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
    <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
    <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
    <a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧"></a>
    <a href="#" class="bds_twi" data-cmd="twi" title="分享到Twitter"></a>
    <a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a>
    <a href="#" class="bds_more" data-cmd="more"></a>
    <a class="bds_count" data-cmd="count"></a>
  </div>
  <script>
    window._bd_share_config = {
      "common": {
        "bdText": "",
        "bdMini": "2",
        "bdMiniList": false,
        "bdPic": ""
      },
      "share": {
        "bdSize": "16",
        "bdStyle": "0"
      },
      "image": {
        "viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
        "viewText": "分享到：",
        "viewSize": "16"
      }
    }
  </script>

<script>
  with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
</script>

      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/bbb.gif" alt="ctrl">
            
              <p class="site-author-name" itemprop="name">ctrl</p>
              <p class="site-description motion-element" itemprop="description">毕业时长两年半的CV工程师</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/yuan2658" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://juejin.im" title="掘金" target="_blank">掘金</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.zhihu.com" title="知乎" target="_blank">知乎</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.spring4all.com" title="Spring For All" target="_blank">Spring For All</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.v2ex.com" title="印记中文" target="_blank">印记中文</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#linux配置tomcat"><span class="nav-number">1.</span> <span class="nav-text">linux配置tomcat</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#一-tomcat简介"><span class="nav-number">1.1.</span> <span class="nav-text">一.tomcat简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二-tomcat下载和安装"><span class="nav-number">1.2.</span> <span class="nav-text">二.tomcat下载和安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#前置条件"><span class="nav-number">1.2.1.</span> <span class="nav-text">前置条件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下载"><span class="nav-number">1.2.2.</span> <span class="nav-text">下载</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#上传"><span class="nav-number">1.2.3.</span> <span class="nav-text">上传</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#解压"><span class="nav-number">1.2.4.</span> <span class="nav-text">解压</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三-tomcat配置"><span class="nav-number">1.3.</span> <span class="nav-text">三.tomcat配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#环境变量配置"><span class="nav-number">1.3.1.</span> <span class="nav-text">环境变量配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#字符集配置"><span class="nav-number">1.3.2.</span> <span class="nav-text">字符集配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#tomcat验证"><span class="nav-number">1.3.3.</span> <span class="nav-text">tomcat验证</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#本地验证"><span class="nav-number">1.3.4.</span> <span class="nav-text">本地验证</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2018 &mdash; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">ctrl</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">站点字数总计&#58;</span>
    
    <span title="站点字数总计">19.6k</span>

  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
        <span class="post-meta-divider">|</span>
        <span class="post-meta-item-icon"><i class="fa fa-eye"></i></span>
        总访问量：<span id="busuanzi_value_site_pv"></span>次
        <span class="post-meta-divider">|</span>
        <span class="post-meta-item-icon"><i class="fa fa-user"></i></span>
        总访客：<span id="busuanzi_value_site_uv"></span>人
  
  

  
</div>




 <!--

<div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v</div>



-->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  

  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/2.1.3/jquery.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/fastclick/1.0.6/fastclick.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazyload/1.9.3/jquery.lazyload.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.pack.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v="></script>

  <script type="text/javascript" src="/js/src/motion.js?v="></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v="></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v="></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v="></script>
<script type="text/javascript" src="/js/src/post-details.js?v="></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v="></script>



  


  




	





  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: 'x7eMnnknw8DLXiaQHKGDXYth-gzGzoHsz',
        appKey: 'Vj1vJImPLhxvGJIpsiDppAGm',
        placeholder: 'ヾﾉ≧∀≦)o来啊，快活啊!',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("x7eMnnknw8DLXiaQHKGDXYth-gzGzoHsz", "Vj1vJImPLhxvGJIpsiDppAGm");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","model":{"jsonPath":"/live2dw/assets/wanko.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":false},"log":false,"tagMode":false});</script></body>
</html>
